package com.ruoyi.crypto.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * SM2加解密配置属性
 */
@Data
@Component
public class SmCryptoConfig {
    /**
     * 强制开启加密
     */
    @Value("${crypto.enabled}")
    private boolean enabled;

    /**
     * 私钥
     */
    @Value("${crypto.sm4.privateKey}")
    private String privateKey;


    /**
     * 公钥
     */
    @Value("${crypto.sm4.publicKey}")
    private String publicKey;


    /**
     * 排除的URL
     */
    @Value("${crypto.sm4.excludeUrls}")
    private List<String> excludeUrls;

    /**
     * 文件上传的ContentTypes
     */
    @Value("${crypto.sm4.fileUploadContentTypes}")
    private List<String> fileUploadContentTypes;

    /**
     * 加密请求头名称
     */
    @Value("${crypto.sm4.headerName}")
    private String headerName;

    /**
     * 编码
     */
    @Value("${crypto.sm4.encoding}")
    private String encoding;

    /**
     * web请求查询参数key
     */
    @Value("${crypto.sm4.webQueryKey}")
    private String webQueryKey;
}



